<?php

namespace app\api\model;

use think\Model;

class UserAddress extends Base
{
    /**
     * 获取用户收货地址
     * @param $uid
     * @return array
     * @throws \app\lib\exception\ThrowError
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public static function getUserAddress($uid)
    {
        $userAddress = self::where('user_id', '=', $uid)
            ->find();

        if (empty($userAddress))
        {
            T(501000);
        }

        return $userAddress->toArray();
    }
}
